瀏覽代碼

Add `upgrade:v17.0.0` command

baijunyao 3 年之前
父節點
當前提交
dbd5eac372
共有 53 個文件被更改,包括 3074 次插入27 次删除
  1. 5 5
      .env.example
  2. 0 6
      .env.k8s
  3. 4 4
      app/Console/Commands/Tencentcloud/Reset.php
  4. 57 0
      app/Console/Commands/Upgrade/V17_0_0.php
  5. 11 10
      config/services.php
  6. 32 0
      database/seeds/ConfigsTableSeeder.php
  7. 7 0
      database/seeds/ConsolesTableSeeder.php
  8. 23 0
      tests/Commands/Upgrade/V17_0_0/CommandTest.php
  9. 13 0
      tests/Commands/Upgrade/V17_0_0/UpgradeTest.php
  10. 41 0
      tests/Commands/Upgrade/databases/V17_0_0/migrations/2014_10_12_000000_create_users_table.php
  11. 36 0
      tests/Commands/Upgrade/databases/V17_0_0/migrations/2014_10_12_100000_create_password_resets_table.php
  12. 39 0
      tests/Commands/Upgrade/databases/V17_0_0/migrations/2016_06_01_000001_create_oauth_auth_codes_table.php
  13. 41 0
      tests/Commands/Upgrade/databases/V17_0_0/migrations/2016_06_01_000002_create_oauth_access_tokens_table.php
  14. 37 0
      tests/Commands/Upgrade/databases/V17_0_0/migrations/2016_06_01_000003_create_oauth_refresh_tokens_table.php
  15. 47 0
      tests/Commands/Upgrade/databases/V17_0_0/migrations/2016_06_01_000004_create_oauth_clients_table.php
  16. 36 0
      tests/Commands/Upgrade/databases/V17_0_0/migrations/2016_06_01_000005_create_oauth_personal_access_clients_table.php
  17. 37 0
      tests/Commands/Upgrade/databases/V17_0_0/migrations/2017_07_11_225347_create_article_tags_table.php
  18. 47 0
      tests/Commands/Upgrade/databases/V17_0_0/migrations/2017_07_11_225347_create_articles_table.php
  19. 42 0
      tests/Commands/Upgrade/databases/V17_0_0/migrations/2017_07_11_225347_create_categories_table.php
  20. 41 0
      tests/Commands/Upgrade/databases/V17_0_0/migrations/2017_07_11_225347_create_comments_table.php
  21. 38 0
      tests/Commands/Upgrade/databases/V17_0_0/migrations/2017_07_11_225347_create_configs_table.php
  22. 39 0
      tests/Commands/Upgrade/databases/V17_0_0/migrations/2017_07_11_225347_create_friends_table.php
  23. 39 0
      tests/Commands/Upgrade/databases/V17_0_0/migrations/2017_07_11_225347_create_friendship_links_table.php
  24. 37 0
      tests/Commands/Upgrade/databases/V17_0_0/migrations/2017_07_11_225347_create_notes_table.php
  25. 49 0
      tests/Commands/Upgrade/databases/V17_0_0/migrations/2017_07_11_225347_create_socialite_users_table.php
  26. 43 0
      tests/Commands/Upgrade/databases/V17_0_0/migrations/2017_07_11_225347_create_tags_table.php
  27. 42 0
      tests/Commands/Upgrade/databases/V17_0_0/migrations/2017_08_26_211441_create_jobs_table.php
  28. 40 0
      tests/Commands/Upgrade/databases/V17_0_0/migrations/2017_08_26_212556_create_failed_jobs_table.php
  29. 39 0
      tests/Commands/Upgrade/databases/V17_0_0/migrations/2017_10_18_203752_create_open_sources_table.php
  30. 35 0
      tests/Commands/Upgrade/databases/V17_0_0/migrations/2018_06_29_032244_create_laravel_follow_tables.php
  31. 39 0
      tests/Commands/Upgrade/databases/V17_0_0/migrations/2018_08_01_191920_create_navs_table.php
  32. 42 0
      tests/Commands/Upgrade/databases/V17_0_0/migrations/2018_09_04_204500_create_sites_table.php
  33. 37 0
      tests/Commands/Upgrade/databases/V17_0_0/migrations/2018_09_26_144126_create_consoles_table.php
  34. 42 0
      tests/Commands/Upgrade/databases/V17_0_0/migrations/2019_05_07_225949_create_socialite_clients_table.php
  35. 38 0
      tests/Commands/Upgrade/databases/V17_0_0/migrations/2020_01_19_215118_create_article_histories_table.php
  36. 42 0
      tests/Commands/Upgrade/databases/V17_0_0/seeds/ArticleTagsTableSeeder.php
  37. 109 0
      tests/Commands/Upgrade/databases/V17_0_0/seeds/ArticlesTableSeeder.php
  38. 64 0
      tests/Commands/Upgrade/databases/V17_0_0/seeds/CategoriesTableSeeder.php
  39. 54 0
      tests/Commands/Upgrade/databases/V17_0_0/seeds/CommentsTableSeeder.php
  40. 627 0
      tests/Commands/Upgrade/databases/V17_0_0/seeds/ConfigsTableSeeder.php
  41. 329 0
      tests/Commands/Upgrade/databases/V17_0_0/seeds/ConsolesTableSeeder.php
  42. 27 0
      tests/Commands/Upgrade/databases/V17_0_0/seeds/DatabaseSeeder.php
  43. 46 0
      tests/Commands/Upgrade/databases/V17_0_0/seeds/FriendsTableSeeder.php
  44. 52 0
      tests/Commands/Upgrade/databases/V17_0_0/seeds/NavsTableSeeder.php
  45. 42 0
      tests/Commands/Upgrade/databases/V17_0_0/seeds/NotesTableSeeder.php
  46. 40 0
      tests/Commands/Upgrade/databases/V17_0_0/seeds/OauthClientsTableSeeder.php
  47. 109 0
      tests/Commands/Upgrade/databases/V17_0_0/seeds/OpenSourcesTableSeeder.php
  48. 52 0
      tests/Commands/Upgrade/databases/V17_0_0/seeds/SitesTableSeeder.php
  49. 88 0
      tests/Commands/Upgrade/databases/V17_0_0/seeds/SocialiteClientsTableSeeder.php
  50. 58 0
      tests/Commands/Upgrade/databases/V17_0_0/seeds/SocialiteUsersTableSeeder.php
  51. 58 0
      tests/Commands/Upgrade/databases/V17_0_0/seeds/TagsTableSeeder.php
  52. 48 0
      tests/Commands/Upgrade/databases/V17_0_0/seeds/UsersTableSeeder.php
  53. 34 2
      tests/_baseline/Feature/Resources/ConfigControllerTest__testIndex__1.json

+ 5 - 5
.env.example

@@ -43,11 +43,11 @@ PUSHER_APP_CLUSTER=mt1
 MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
 MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
 
-TENCENTCLOUD_REGION=ap-beijing
-TENCENTCLOUD_INSTANCE_ID=
-TENCENTCLOUD_SSH_KEY_ID=
-TENCENTCLOUD_SECRET_ID=
-TENCENTCLOUD_SECRET_KEY=
+TENCENT_CLOUD_REGION=
+TENCENT_CLOUD_INSTANCE_ID=
+TENCENT_CLOUD_SSH_KEY_ID=
+TENCENT_CLOUD_SECRET_ID=
+TENCENT_CLOUD_SECRET_KEY=
 
 DEPLOY_IP=127.0.0.1
 DEPLOY_PORT=22

+ 0 - 6
.env.k8s

@@ -38,9 +38,3 @@ BLOG_BRANCH=master
 
 MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
 MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
-
-TENCENTCLOUD_REGION=ap-beijing
-TENCENTCLOUD_INSTANCE_ID=
-TENCENTCLOUD_SSH_KEY_ID=
-TENCENTCLOUD_SECRET_ID=
-TENCENTCLOUD_SECRET_KEY=

+ 4 - 4
app/Console/Commands/Tencentcloud/Reset.php

@@ -2,7 +2,7 @@
 
 declare(strict_types=1);
 
-namespace App\Console\Commands\Tencentcloud;
+namespace App\Console\Commands\TencentCloud;
 
 use Illuminate\Console\Command;
 use TencentCloud\Common\Credential;
@@ -33,7 +33,7 @@ class Reset extends Command
      */
     public function handle()
     {
-        $tencentcloud_config = config('services.tencentcloud');
+        $tencent_cloud_config = config('services.tencent_cloud');
 
         [
             'secret_id'   => $secret_id,
@@ -43,11 +43,11 @@ class Reset extends Command
             'instance_id' => $instance_id,
             'image_id'    => $image_id,
             'host_name'   => $host_name
-        ] = $tencentcloud_config;
+        ] = $tencent_cloud_config;
 
         $this->table(
             ['Name', 'Value'],
-            collect($tencentcloud_config)->map(fn ($value, $key) => ['name' => $key, 'value' => $value]),
+            collect($tencent_cloud_config)->map(fn ($value, $key) => ['name' => $key, 'value' => $value]),
         );
 
         $client                 = new CvmClient(new Credential($secret_id, $secret_key), $region);

+ 57 - 0
app/Console/Commands/Upgrade/V17_0_0.php

@@ -0,0 +1,57 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Console\Commands\Upgrade;
+
+use DB;
+use Illuminate\Console\Command;
+
+class V17_0_0 extends Command
+{
+    public const CONFIG = [
+        [
+            'id'         => 205,
+            'name'       => 'services.tencent_cloud.secret_id',
+            'value'      => '',
+            'created_at' => '2022-06-15 20:06:00',
+            'updated_at' => '2022-06-15 20:06:00',
+            'deleted_at' => null,
+        ],
+        [
+            'id'         => 206,
+            'name'       => 'services.tencent_cloud.secret_key',
+            'value'      => '',
+            'created_at' => '2022-06-15 20:06:00',
+            'updated_at' => '2022-06-15 20:06:00',
+            'deleted_at' => null,
+        ],
+        [
+            'id'         => 207,
+            'name'       => 'services.tencent_cloud.region',
+            'value'      => '',
+            'created_at' => '2022-06-15 20:06:00',
+            'updated_at' => '2022-06-15 20:06:00',
+            'deleted_at' => null,
+        ],
+        [
+            'id'         => 208,
+            'name'       => 'services.tencent_cloud.project_id',
+            'value'      => '',
+            'created_at' => '2022-06-15 20:06:00',
+            'updated_at' => '2022-06-15 20:06:00',
+            'deleted_at' => null,
+        ],
+    ];
+    protected $signature   = 'upgrade:v17.0.0';
+    protected $description = 'Upgrade to v17.0.0';
+
+    public function handle(): int
+    {
+        foreach (self::CONFIG as $config) {
+            DB::table('configs')->insertOrIgnore($config);
+        }
+
+        return 0;
+    }
+}

+ 11 - 10
config/services.php

@@ -50,6 +50,17 @@ return [
         'secret' => env('BAIDU_SECRET')
     ],
 
+    'tencent_cloud' => [
+        'secret_id' => env('TENCENT_CLOUD_SECRET_ID'),
+        'secret_key' => env('TENCENT_CLOUD_SECRET_KEY'),
+        'region' => env('TENCENT_CLOUD_REGION'),
+        'project_id' => env('TENCENT_CLOUD_PROJECT_ID'),
+        'instance_id' => env('TENCENT_CLOUD_INSTANCE_ID'),
+        'ssh_key_id' => env('TENCENT_CLOUD_SSH_KEY_ID'),
+        'image_id' => env('TENCENT_CLOUD_IMAGE_ID'),
+        'host_name' => env('TENCENT_CLOUD_HOST_NAME', 'development'),
+    ],
+
     'weibo' => [
         'client_id' => env('WEIBO_KEY'),
         'client_secret' => env('WEIBO_SECRET'),
@@ -85,14 +96,4 @@ return [
         'client_secret' => env('VKONTAKTE_SECRET'),
         'redirect' => env('APP_URL').'/auth/oauth/handleProviderCallback/vkontakte'
     ],
-
-    'tencentcloud' => [
-        'secret_id' => env('TENCENTCLOUD_SECRET_ID'),
-        'secret_key' => env('TENCENTCLOUD_SECRET_KEY'),
-        'instance_id' => env('TENCENTCLOUD_INSTANCE_ID'),
-        'region' => env('TENCENTCLOUD_REGION'),
-        'ssh_key_id' => env('TENCENTCLOUD_SSH_KEY_ID'),
-        'image_id' => env('TENCENTCLOUD_IMAGE_ID'),
-        'host_name' => env('TENCENTCLOUD_HOST_NAME', 'development'),
-    ],
 ];

+ 32 - 0
database/seeds/ConfigsTableSeeder.php

@@ -622,6 +622,38 @@ class ConfigsTableSeeder extends Seeder
                 'updated_at' => '2018-12-04 22:29:52',
                 'deleted_at' => null,
             ],
+            [
+                'id'         => 205,
+                'name'       => 'services.tencent_cloud.secret_id',
+                'value'      => '',
+                'created_at' => '2022-06-15 20:06:00',
+                'updated_at' => '2022-06-15 20:06:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 206,
+                'name'       => 'services.tencent_cloud.secret_key',
+                'value'      => '',
+                'created_at' => '2022-06-15 20:06:00',
+                'updated_at' => '2022-06-15 20:06:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 207,
+                'name'       => 'services.tencent_cloud.region',
+                'value'      => '',
+                'created_at' => '2022-06-15 20:06:00',
+                'updated_at' => '2022-06-15 20:06:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 208,
+                'name'       => 'services.tencent_cloud.project_id',
+                'value'      => '',
+                'created_at' => '2022-06-15 20:06:00',
+                'updated_at' => '2022-06-15 20:06:00',
+                'deleted_at' => null,
+            ],
         ]);
     }
 }

+ 7 - 0
database/seeds/ConsolesTableSeeder.php

@@ -324,6 +324,13 @@ class ConsolesTableSeeder extends Seeder
                 'updated_at' => '2021-05-29 23:16:00',
                 'deleted_at' => null,
             ],
+            [
+                'id'         => 46,
+                'name'       => 'App\Console\Commands\Upgrade\V17_0_0',
+                'created_at' => '2022-06-15 20:16:00',
+                'updated_at' => '2022-06-15 20:16:00',
+                'deleted_at' => null,
+            ],
         ]);
     }
 }

+ 23 - 0
tests/Commands/Upgrade/V17_0_0/CommandTest.php

@@ -0,0 +1,23 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\V17_0_0;
+
+use App\Console\Commands\Upgrade\V17_0_0;
+
+class CommandTest extends \Tests\Commands\Upgrade\TestCase
+{
+    public function testCommand(): void
+    {
+        foreach (V17_0_0::CONFIG as $config) {
+            $this->assertDatabaseMissing('configs', $config);
+        }
+
+        $this->artisan('upgrade:v17.0.0');
+
+        foreach (V17_0_0::CONFIG as $config) {
+            $this->assertDatabaseHas('configs', $config);
+        }
+    }
+}

+ 13 - 0
tests/Commands/Upgrade/V17_0_0/UpgradeTest.php

@@ -0,0 +1,13 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\V17_0_0;
+
+class UpgradeTest extends \Tests\Commands\Upgrade\TestCase
+{
+    public function testUpgrade(): void
+    {
+        $this->artisan('bjyblog:update')->assertExitCode(0);
+    }
+}

+ 41 - 0
tests/Commands/Upgrade/databases/V17_0_0/migrations/2014_10_12_000000_create_users_table.php

@@ -0,0 +1,41 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Migrations;
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateUsersTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('users', function (Blueprint $table) {
+            $table->id();
+            $table->string('name');
+            $table->string('email')->unique();
+            $table->timestamp('email_verified_at')->nullable();
+            $table->string('password');
+            $table->rememberToken();
+            $table->timestamps();
+            $table->softDeletes();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('users');
+    }
+}

+ 36 - 0
tests/Commands/Upgrade/databases/V17_0_0/migrations/2014_10_12_100000_create_password_resets_table.php

@@ -0,0 +1,36 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Migrations;
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreatePasswordResetsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('password_resets', function (Blueprint $table) {
+            $table->string('email')->index();
+            $table->string('token');
+            $table->timestamp('created_at')->nullable();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('password_resets');
+    }
+}

+ 39 - 0
tests/Commands/Upgrade/databases/V17_0_0/migrations/2016_06_01_000001_create_oauth_auth_codes_table.php

@@ -0,0 +1,39 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Migrations;
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateOauthAuthCodesTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('oauth_auth_codes', function (Blueprint $table) {
+            $table->string('id', 100)->primary();
+            $table->integer('user_id');
+            $table->unsignedInteger('client_id');
+            $table->text('scopes')->nullable();
+            $table->unsignedTinyInteger('revoked');
+            $table->dateTime('expires_at')->nullable();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('oauth_auth_codes');
+    }
+}

+ 41 - 0
tests/Commands/Upgrade/databases/V17_0_0/migrations/2016_06_01_000002_create_oauth_access_tokens_table.php

@@ -0,0 +1,41 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Migrations;
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateOauthAccessTokensTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('oauth_access_tokens', function (Blueprint $table) {
+            $table->string('id', 100)->primary();
+            $table->integer('user_id')->index()->nullable();
+            $table->unsignedInteger('client_id');
+            $table->string('name')->nullable();
+            $table->text('scopes')->nullable();
+            $table->unsignedTinyInteger('revoked');
+            $table->timestamps();
+            $table->dateTime('expires_at')->nullable();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('oauth_access_tokens');
+    }
+}

+ 37 - 0
tests/Commands/Upgrade/databases/V17_0_0/migrations/2016_06_01_000003_create_oauth_refresh_tokens_table.php

@@ -0,0 +1,37 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Migrations;
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateOauthRefreshTokensTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('oauth_refresh_tokens', function (Blueprint $table) {
+            $table->string('id', 100)->primary();
+            $table->string('access_token_id', 100)->index();
+            $table->unsignedTinyInteger('revoked');
+            $table->dateTime('expires_at')->nullable();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('oauth_refresh_tokens');
+    }
+}

+ 47 - 0
tests/Commands/Upgrade/databases/V17_0_0/migrations/2016_06_01_000004_create_oauth_clients_table.php

@@ -0,0 +1,47 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Migrations;
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateOauthClientsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        if (Schema::hasTable('oauth_clients')) {
+            Schema::rename('oauth_clients', 'socialite_clients');
+        }
+
+        Schema::create('oauth_clients', function (Blueprint $table) {
+            $table->increments('id');
+            $table->integer('user_id')->index()->nullable();
+            $table->string('name');
+            $table->string('secret', 100);
+            $table->string('provider')->nullable();
+            $table->text('redirect');
+            $table->unsignedTinyInteger('personal_access_client');
+            $table->unsignedTinyInteger('password_client');
+            $table->unsignedTinyInteger('revoked');
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('oauth_clients');
+    }
+}

+ 36 - 0
tests/Commands/Upgrade/databases/V17_0_0/migrations/2016_06_01_000005_create_oauth_personal_access_clients_table.php

@@ -0,0 +1,36 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Migrations;
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateOauthPersonalAccessClientsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('oauth_personal_access_clients', function (Blueprint $table) {
+            $table->increments('id');
+            $table->unsignedInteger('client_id')->index();
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('oauth_personal_access_clients');
+    }
+}

+ 37 - 0
tests/Commands/Upgrade/databases/V17_0_0/migrations/2017_07_11_225347_create_article_tags_table.php

@@ -0,0 +1,37 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Migrations;
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateArticleTagsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('article_tags', function (Blueprint $table) {
+            $table->integer('article_id')->unsigned()->default(0)->comment('文章id');
+            $table->integer('tag_id')->unsigned()->default(0)->comment('标签id');
+            $table->timestamps();
+            $table->softDeletes();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('article_tags');
+    }
+}

+ 47 - 0
tests/Commands/Upgrade/databases/V17_0_0/migrations/2017_07_11_225347_create_articles_table.php

@@ -0,0 +1,47 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Migrations;
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateArticlesTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('articles', function (Blueprint $table) {
+            $table->increments('id')->comment('文章表主键');
+            $table->unsignedTinyInteger('category_id')->default(0)->comment('分类id');
+            $table->string('title')->default('')->comment('标题');
+            $table->string('slug')->default('')->comment('slug');
+            $table->string('author')->default('')->comment('作者');
+            $table->mediumText('markdown')->comment('markdown文章内容');
+            $table->mediumText('html')->comment('markdown转的html页面');
+            $table->string('description')->default('')->comment('描述');
+            $table->string('keywords')->default('')->comment('关键词');
+            $table->string('cover')->default('')->comment('封面图');
+            $table->unsignedTinyInteger('is_top')->default(0)->comment('是否置顶 1是 0否');
+            $table->integer('views')->unsigned()->default(0);
+            $table->timestamps();
+            $table->softDeletes();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('articles');
+    }
+}

+ 42 - 0
tests/Commands/Upgrade/databases/V17_0_0/migrations/2017_07_11_225347_create_categories_table.php

@@ -0,0 +1,42 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Migrations;
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateCategoriesTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('categories', function (Blueprint $table) {
+            $table->increments('id')->comment('分类主键id');
+            $table->string('name', 15)->default('')->comment('分类名称');
+            $table->string('slug')->default('')->comment('slug');
+            $table->string('keywords')->default('')->comment('关键词');
+            $table->string('description')->default('')->comment('描述');
+            $table->unsignedTinyInteger('sort')->default(0)->comment('排序');
+            $table->unsignedTinyInteger('pid')->default(0)->comment('父级栏目id');
+            $table->timestamps();
+            $table->softDeletes();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('categories');
+    }
+}

+ 41 - 0
tests/Commands/Upgrade/databases/V17_0_0/migrations/2017_07_11_225347_create_comments_table.php

@@ -0,0 +1,41 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Migrations;
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateCommentsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('comments', function (Blueprint $table) {
+            $table->bigIncrements('id');
+            $table->integer('socialite_user_id')->unsigned()->default(0);
+            $table->integer('article_id')->unsigned();
+            $table->text('content');
+            $table->unsignedTinyInteger('is_audited')->default(0);
+            $table->nestedSet();
+            $table->timestamps();
+            $table->softDeletes();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('comments');
+    }
+}

+ 38 - 0
tests/Commands/Upgrade/databases/V17_0_0/migrations/2017_07_11_225347_create_configs_table.php

@@ -0,0 +1,38 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Migrations;
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateConfigsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('configs', function (Blueprint $table) {
+            $table->increments('id')->comment('主键');
+            $table->string('name', 100)->default('')->comment('配置项键名');
+            $table->text('value')->nullable()->comment('配置项键值 1表示开启 0 关闭');
+            $table->timestamps();
+            $table->softDeletes();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('configs');
+    }
+}

+ 39 - 0
tests/Commands/Upgrade/databases/V17_0_0/migrations/2017_07_11_225347_create_friends_table.php

@@ -0,0 +1,39 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Migrations;
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateFriendsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('friends', function (Blueprint $table) {
+            $table->increments('id')->comment('主键id');
+            $table->string('name', 50)->default('')->comment('链接名');
+            $table->string('url')->default('')->comment('链接地址');
+            $table->unsignedTinyInteger('sort')->nullable()->default(1)->comment('排序');
+            $table->timestamps();
+            $table->softDeletes();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('friends');
+    }
+}

+ 39 - 0
tests/Commands/Upgrade/databases/V17_0_0/migrations/2017_07_11_225347_create_friendship_links_table.php

@@ -0,0 +1,39 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Migrations;
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateFriendshipLinksTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('friendship_links', function (Blueprint $table) {
+            $table->increments('id')->comment('主键id');
+            $table->string('name', 50)->default('')->comment('链接名');
+            $table->string('url')->default('')->comment('链接地址');
+            $table->unsignedTinyInteger('sort')->nullable()->default(1)->comment('排序');
+            $table->timestamps();
+            $table->softDeletes();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('friendship_links');
+    }
+}

+ 37 - 0
tests/Commands/Upgrade/databases/V17_0_0/migrations/2017_07_11_225347_create_notes_table.php

@@ -0,0 +1,37 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Migrations;
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateNotesTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('notes', function (Blueprint $table) {
+            $table->increments('id')->comment('主键id');
+            $table->text('content')->comment('内容');
+            $table->timestamps();
+            $table->softDeletes();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('notes');
+    }
+}

+ 49 - 0
tests/Commands/Upgrade/databases/V17_0_0/migrations/2017_07_11_225347_create_socialite_users_table.php

@@ -0,0 +1,49 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Migrations;
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateSocialiteUsersTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        if (!Schema::hasTable('oauth_users') && !Schema::hasTable('socialite_users')) {
+            Schema::create('socialite_users', function (Blueprint $table) {
+                $table->increments('id')->comment('主键id');
+                $table->unsignedTinyInteger('socialite_client_id')->default(1)->comment('类型 1:QQ  2:新浪微博 3:github');
+                $table->string('name', 30)->default('')->comment('第三方昵称');
+                $table->string('avatar')->default('')->comment('头像');
+                $table->string('openid', 40)->default('')->comment('第三方用户id');
+                $table->string('access_token')->default('')->comment('access_token token');
+                $table->string('last_login_ip', 16)->default('')->comment('最后登录ip');
+                $table->integer('login_times')->unsigned()->default(0)->comment('登录次数');
+                $table->string('email')->default('')->comment('邮箱');
+                $table->unsignedTinyInteger('is_admin')->default(0)->comment('是否是admin');
+                $table->unsignedTinyInteger('is_blocked')->default(0);
+                $table->rememberToken();
+                $table->timestamps();
+                $table->softDeletes();
+            });
+        }
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('socialite_users');
+    }
+}

+ 43 - 0
tests/Commands/Upgrade/databases/V17_0_0/migrations/2017_07_11_225347_create_tags_table.php

@@ -0,0 +1,43 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Migrations;
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateTagsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @update 2019年10月15日 11:28:45 by jason
+     * @desc 添加 标签的关键字和描述。
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('tags', function (Blueprint $table) {
+            $table->increments('id')->comment('标签主键');
+            $table->string('name', 20)->default('')->comment('标签名');
+            $table->string('slug')->default('')->comment('slug');
+            $table->string('keywords')->default('')->comment('标签的关键字');
+            $table->string('description')->default('')->comment('标签的描述');
+            $table->timestamps();
+            $table->softDeletes();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('tags');
+    }
+}

+ 42 - 0
tests/Commands/Upgrade/databases/V17_0_0/migrations/2017_08_26_211441_create_jobs_table.php

@@ -0,0 +1,42 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Migrations;
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateJobsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('jobs', function (Blueprint $table) {
+            $table->id();
+            $table->string('uuid')->unique();
+            $table->string('queue');
+            $table->longText('payload');
+            $table->tinyInteger('attempts')->unsigned();
+            $table->unsignedInteger('reserved_at')->nullable();
+            $table->unsignedInteger('available_at');
+            $table->unsignedInteger('created_at');
+            $table->index(['queue', 'reserved_at']);
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('jobs');
+    }
+}

+ 40 - 0
tests/Commands/Upgrade/databases/V17_0_0/migrations/2017_08_26_212556_create_failed_jobs_table.php

@@ -0,0 +1,40 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Migrations;
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateFailedJobsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('failed_jobs', function (Blueprint $table) {
+            $table->id();
+            $table->string('uuid')->unique();
+            $table->text('connection');
+            $table->text('queue');
+            $table->longText('payload');
+            $table->longText('exception');
+            $table->timestamp('failed_at')->useCurrent();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('failed_jobs');
+    }
+}

+ 39 - 0
tests/Commands/Upgrade/databases/V17_0_0/migrations/2017_10_18_203752_create_open_sources_table.php

@@ -0,0 +1,39 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Migrations;
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateOpenSourcesTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('open_sources', function (Blueprint $table) {
+            $table->increments('id')->comment('项目主键');
+            $table->tinyInteger('sort')->default(1)->comment('排序');
+            $table->tinyInteger('type')->default(1)->comment('1:github 2:gitee');
+            $table->string('name')->default('')->comment('项目名');
+            $table->timestamps();
+            $table->softDeletes();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('open_sources');
+    }
+}

+ 35 - 0
tests/Commands/Upgrade/databases/V17_0_0/migrations/2018_06_29_032244_create_laravel_follow_tables.php

@@ -0,0 +1,35 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Migrations;
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateLaravelFollowTables extends Migration
+{
+    /**
+     * Run the migrations.
+     */
+    public function up()
+    {
+        Schema::create(config('follow.followable_table', 'followables'), function (Blueprint $table) {
+            $table->unsignedBigInteger(config('follow.users_table_foreign_key', 'user_id'));
+            $table->unsignedInteger('followable_id');
+            $table->string('followable_type')->index();
+            $table->string('relation')->default('follow')->comment('follow/like/subscribe/favorite/upvote/downvote');
+            $table->softDeletes();
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     */
+    public function down()
+    {
+        Schema::drop(config('follow.followable_table', 'followables'));
+    }
+}

+ 39 - 0
tests/Commands/Upgrade/databases/V17_0_0/migrations/2018_08_01_191920_create_navs_table.php

@@ -0,0 +1,39 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Migrations;
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateNavsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('navs', function (Blueprint $table) {
+            $table->increments('id')->comment('菜单主键');
+            $table->tinyInteger('sort')->default(1)->comment('排序');
+            $table->string('name')->default('')->comment('菜单名');
+            $table->string('url')->default('')->comment('链接');
+            $table->timestamps();
+            $table->softDeletes();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('navs');
+    }
+}

+ 42 - 0
tests/Commands/Upgrade/databases/V17_0_0/migrations/2018_09_04_204500_create_sites_table.php

@@ -0,0 +1,42 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Migrations;
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateSitesTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('sites', function (Blueprint $table) {
+            $table->increments('id');
+            $table->integer('socialite_user_id')->unsigned()->default(0)->comment('第三方用户id');
+            $table->string('name')->default('')->comment('网站名');
+            $table->string('description')->default('')->comment('描述');
+            $table->string('url')->default('')->comment('网站链接');
+            $table->tinyInteger('audit')->default(0)->comment('审核状态1为通过审核');
+            $table->tinyInteger('sort')->default(0)->comment('排序');
+            $table->timestamps();
+            $table->softDeletes();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('sites');
+    }
+}

+ 37 - 0
tests/Commands/Upgrade/databases/V17_0_0/migrations/2018_09_26_144126_create_consoles_table.php

@@ -0,0 +1,37 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Migrations;
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateConsolesTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('consoles', function (Blueprint $table) {
+            $table->increments('id');
+            $table->string('name')->default('')->comment('名称');
+            $table->timestamps();
+            $table->softDeletes();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('consoles');
+    }
+}

+ 42 - 0
tests/Commands/Upgrade/databases/V17_0_0/migrations/2019_05_07_225949_create_socialite_clients_table.php

@@ -0,0 +1,42 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Migrations;
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateSocialiteClientsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        if (!Schema::hasTable('socialite_clients')) {
+            Schema::create('socialite_clients', function (Blueprint $table) {
+                $table->increments('id');
+                $table->string('name')->default('');
+                $table->string('icon')->default('');
+                $table->string('client_id')->default('');
+                $table->string('client_secret')->default('');
+                $table->timestamps();
+                $table->softDeletes();
+            });
+        }
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('socialite_clients');
+    }
+}

+ 38 - 0
tests/Commands/Upgrade/databases/V17_0_0/migrations/2020_01_19_215118_create_article_histories_table.php

@@ -0,0 +1,38 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Migrations;
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateArticleHistoriesTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('article_histories', function (Blueprint $table) {
+            $table->increments('id');
+            $table->integer('article_id');
+            $table->mediumText('markdown');
+            $table->timestamps();
+            $table->softDeletes();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('article_histories');
+    }
+}

+ 42 - 0
tests/Commands/Upgrade/databases/V17_0_0/seeds/ArticleTagsTableSeeder.php

@@ -0,0 +1,42 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Seeds;
+
+use Illuminate\Database\Seeder;
+use Illuminate\Support\Facades\DB;
+
+class ArticleTagsTableSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        if (DB::table('article_tags')->exists()) {
+            $this->command->getOutput()->writeln('<question>Skipping: ' . __CLASS__ . '</question>');
+
+            return;
+        }
+
+        DB::table('article_tags')->insert([
+            [
+                'article_id' => 1,
+                'tag_id'     => 1,
+                'created_at' => '2017-7-18 07:35:12',
+                'updated_at' => '2016-7-18 07:35:12',
+                'deleted_at' => null,
+            ],
+            [
+                'article_id' => 2,
+                'tag_id'     => 2,
+                'created_at' => '2019-01-04 16:35:12',
+                'updated_at' => '2019-01-04 16:35:12',
+                'deleted_at' => '2019-01-04 16:35:12',
+            ],
+        ]);
+    }
+}

+ 109 - 0
tests/Commands/Upgrade/databases/V17_0_0/seeds/ArticlesTableSeeder.php

@@ -0,0 +1,109 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Seeds;
+
+use Illuminate\Database\Seeder;
+use Illuminate\Support\Facades\DB;
+
+class ArticlesTableSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        if (DB::table('articles')->exists()) {
+            $this->command->getOutput()->writeln('<question>Skipping: ' . __CLASS__ . '</question>');
+
+            return;
+        }
+
+        DB::table('articles')->insert([
+            [
+                'id'          => 1,
+                'category_id' => 1,
+                'title'       => '欢迎使用 laravel-bjyblog',
+                'slug'        => 'welcome-to-laravel-bjyblog',
+                'author'      => '白俊遥',
+                'markdown'    => '1. [切换语言](https://baijunyao.com/docs/laravel-bjyblog/其他配置.html)
+![](/images/default/article.png)
+2. [清空测试数据](https://baijunyao.com/docs/laravel-bjyblog/清空测试数据.html)
+3. [升级版本](https://baijunyao.com/docs/laravel-bjyblog/升级版本.html)',
+                'html'        => '<ol>
+<li>
+<a href="https://baijunyao.com/docs/laravel-bjyblog/%E5%85%B6%E4%BB%96%E9%85%8D%E7%BD%AE.html">切换语言</a>
+<img src="/images/default/article.png" alt="" />
+</li>
+<li>
+<a href="https://baijunyao.com/docs/laravel-bjyblog/%E6%B8%85%E7%A9%BA%E6%B5%8B%E8%AF%95%E6%95%B0%E6%8D%AE.html">清空测试数据</a>
+</li>
+<li>
+<a href="https://baijunyao.com/docs/laravel-bjyblog/%E5%8D%87%E7%BA%A7%E7%89%88%E6%9C%AC.html">升级版本</a>
+</li>
+</ol>
+',
+                'description' => '欢迎使用 laravel-bjyblog',
+                'keywords'    => 'laravel',
+                'cover'       => '/images/default/article.png',
+                'is_top'      => 1,
+                'views'       => 666,
+                'created_at'  => '2017-7-16 07:35:12',
+                'updated_at'  => '2016-7-16 07:35:12',
+                'deleted_at'  => null,
+            ],
+            [
+                'id'          => 2,
+                'category_id' => 1,
+                'title'       => '已删除',
+                'slug'        => 'deleted',
+                'author'      => '白俊遥',
+                'markdown'    => '内容',
+                'html'        => '内容',
+                'description' => '描述',
+                'keywords'    => 'test',
+                'cover'       => '/images/default/article.png',
+                'is_top'      => 0,
+                'views'       => 222,
+                'created_at'  => '2019-01-04 16:35:12',
+                'updated_at'  => '2019-01-04 16:35:12',
+                'deleted_at'  => '2019-01-04 16:35:12',
+            ],
+            [
+                'id'          => 3,
+                'category_id' => 1,
+                'title'       => 'Welcome to laravel-bjyblog',
+                'slug'        => 'welcome-to-laravel-bjyblog',
+                'author'      => 'baijunyao',
+                'markdown'    => '1. [Switch language](https://baijunyao.com/docs/laravel-bjyblog/en/OtherConfig.html)
+![](/images/default/article.png)
+2. [Clear test data](https://baijunyao.com/docs/laravel-bjyblog/en/ClearTestData.html)
+3. [Upgrade version](https://baijunyao.com/docs/laravel-bjyblog/en/Upgrade.html)',
+                'html'        => '<ol>
+<li>
+<a href="https://baijunyao.com/docs/laravel-bjyblog/en/OtherConfig.html">Switch language</a>
+<img src="/images/default/article.png" alt="" />
+</li>
+<li>
+<a href="https://baijunyao.com/docs/laravel-bjyblog/en/ClearTestData.html">Clear test data</a>
+</li>
+<li>
+<a href="https://baijunyao.com/docs/laravel-bjyblog/en/Upgrade.html">Upgrade version</a>
+</li>
+</ol>
+',
+                'description' => 'welcome to laravel-bjyblog',
+                'keywords'    => 'laravel-bjyblog',
+                'cover'       => '/images/default/article.png',
+                'is_top'      => 0,
+                'views'       => 333,
+                'created_at'  => '2019-10-05 14:35:12',
+                'updated_at'  => '2019-10-05 14:35:12',
+                'deleted_at'  => null,
+            ],
+        ]);
+    }
+}

+ 64 - 0
tests/Commands/Upgrade/databases/V17_0_0/seeds/CategoriesTableSeeder.php

@@ -0,0 +1,64 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Seeds;
+
+use Illuminate\Database\Seeder;
+use Illuminate\Support\Facades\DB;
+
+class CategoriesTableSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        if (DB::table('categories')->exists()) {
+            $this->command->getOutput()->writeln('<question>Skipping: ' . __CLASS__ . '</question>');
+
+            return;
+        }
+
+        DB::table('categories')->insert([
+            [
+                'id'          => 1,
+                'name'        => 'php',
+                'slug'        => 'php',
+                'keywords'    => 'php',
+                'description' => 'php相关的文章',
+                'sort'        => 1,
+                'pid'         => 0,
+                'created_at'  => '2017-7-16 07:35:12',
+                'updated_at'  => '2016-7-16 07:35:12',
+                'deleted_at'  => null,
+            ],
+            [
+                'id'          => 2,
+                'name'        => '用于删除',
+                'slug'        => 'for-deletion',
+                'keywords'    => '用于删除',
+                'description' => '用于删除',
+                'sort'        => 2,
+                'pid'         => 0,
+                'created_at'  => '2019-01-04 16:35:12',
+                'updated_at'  => '2019-01-04 16:35:12',
+                'deleted_at'  => null,
+            ],
+            [
+                'id'          => 3,
+                'name'        => '已删除',
+                'slug'        => 'deleted',
+                'keywords'    => '已删除',
+                'description' => '已删除',
+                'sort'        => 3,
+                'pid'         => 0,
+                'created_at'  => '2019-01-04 16:35:12',
+                'updated_at'  => '2019-01-04 16:35:12',
+                'deleted_at'  => '2019-01-04 16:35:12',
+            ],
+        ]);
+    }
+}

+ 54 - 0
tests/Commands/Upgrade/databases/V17_0_0/seeds/CommentsTableSeeder.php

@@ -0,0 +1,54 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Seeds;
+
+use Illuminate\Database\Seeder;
+use Illuminate\Support\Facades\DB;
+
+class CommentsTableSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        if (DB::table('comments')->exists()) {
+            $this->command->getOutput()->writeln('<question>Skipping: ' . __CLASS__ . '</question>');
+
+            return;
+        }
+
+        DB::table('comments')->insert([
+            [
+                'id'                => 1,
+                'socialite_user_id' => 1,
+                'article_id'        => 1,
+                'content'           => '评论的内容',
+                'is_audited'        => 1,
+                '_lft'              => 1,
+                '_rgt'              => 2,
+                'parent_id'         => null,
+                'created_at'        => '2017-7-16 07:35:12',
+                'updated_at'        => '2016-7-16 07:35:12',
+                'deleted_at'        => null,
+            ],
+            [
+                'id'                => 2,
+                'socialite_user_id' => 1,
+                'article_id'        => 1,
+                'content'           => '已删除',
+                'is_audited'        => 1,
+                '_lft'              => 3,
+                '_rgt'              => 4,
+                'parent_id'         => null,
+                'created_at'        => '2019-01-04 16:35:12',
+                'updated_at'        => '2019-01-04 16:35:12',
+                'deleted_at'        => '2019-01-04 16:35:12',
+            ],
+        ]);
+    }
+}

+ 627 - 0
tests/Commands/Upgrade/databases/V17_0_0/seeds/ConfigsTableSeeder.php

@@ -0,0 +1,627 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Seeds;
+
+use Illuminate\Database\Seeder;
+use Illuminate\Support\Facades\DB;
+
+class ConfigsTableSeeder extends Seeder
+{
+    /**
+     * Auto generated seed file
+     *
+     * @return void
+     */
+    public function run()
+    {
+        if (DB::table('configs')->exists()) {
+            $this->command->getOutput()->writeln('<question>Skipping: ' . __CLASS__ . '</question>');
+
+            return;
+        }
+
+        DB::table('configs')->insert([
+            [
+                'id'         => 101,
+                'name'       => 'app.name',
+                'value'      => '白俊遥博客',
+                'created_at' => '2018-08-22 21:03:01',
+                'updated_at' => '2018-08-22 21:03:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 102,
+                'name'       => 'bjyblog.head.keywords',
+                'value'      => '个人博客,博客模板,thinkphp,laravel博客,php博客,技术博客,白俊遥',
+                'created_at' => '2018-08-22 21:03:01',
+                'updated_at' => '2018-08-22 21:03:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 103,
+                'name'       => 'bjyblog.head.description',
+                'value'      => '白俊遥的php博客,个人技术博客,bjyblog,bjyadmin官方网站',
+                'created_at' => '2018-08-22 21:03:01',
+                'updated_at' => '2018-08-22 21:03:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 107,
+                'name'       => 'bjyblog.water.text',
+                'value'      => 'baijunyao.com',
+                'created_at' => '2018-08-22 21:03:01',
+                'updated_at' => '2018-08-22 21:03:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 109,
+                'name'       => 'bjyblog.water.size',
+                'value'      => '15',
+                'created_at' => '2018-08-22 21:03:01',
+                'updated_at' => '2018-08-22 21:03:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 110,
+                'name'       => 'bjyblog.water.color',
+                'value'      => '#008CBA',
+                'created_at' => '2018-08-22 21:03:01',
+                'updated_at' => '2018-08-22 21:03:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 117,
+                'name'       => 'bjyblog.icp',
+                'value'      => '豫ICP备14009546号-3',
+                'created_at' => '2018-08-22 21:03:01',
+                'updated_at' => '2018-08-22 21:03:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 118,
+                'name'       => 'bjyblog.admin_email',
+                'value'      => 'baijunyao@baijunyao.com',
+                'created_at' => '2018-08-22 21:03:01',
+                'updated_at' => '2018-08-22 21:03:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 119,
+                'name'       => 'bjyblog.copyright_word',
+                'value'      => '本文为白俊遥原创文章,转载无需和我联系,但请注明来自<a href="http://baijunyao.com">白俊遥博客</a>http://baijunyao.com',
+                'created_at' => '2018-08-22 21:03:01',
+                'updated_at' => '2018-08-22 21:03:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 123,
+                'name'       => 'bjyblog.statistics',
+                'value'      => '',
+                'created_at' => '2018-08-25 17:04:02',
+                'updated_at' => '2018-08-25 17:04:02',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 125,
+                'name'       => 'bjyblog.author',
+                'value'      => '白俊遥',
+                'created_at' => '2018-08-22 21:03:01',
+                'updated_at' => '2018-08-22 21:03:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 128,
+                'name'       => 'bjyblog.baidu_site_url',
+                'value'      => '',
+                'created_at' => '2018-08-22 21:03:01',
+                'updated_at' => '2018-08-22 21:03:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 141,
+                'name'       => 'bjyblog.alt_word',
+                'value'      => '白俊遥博客',
+                'created_at' => '2018-08-22 21:03:01',
+                'updated_at' => '2018-08-22 21:03:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 142,
+                'name'       => 'mail.mailers.smtp.host',
+                'value'      => '',
+                'created_at' => '2018-08-22 21:03:01',
+                'updated_at' => '2018-08-22 21:03:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 143,
+                'name'       => 'mail.mailers.smtp.username',
+                'value'      => '',
+                'created_at' => '2018-08-22 21:03:01',
+                'updated_at' => '2018-08-22 21:03:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 144,
+                'name'       => 'mail.mailers.smtp.password',
+                'value'      => '',
+                'created_at' => '2018-08-22 21:03:01',
+                'updated_at' => '2018-08-22 21:03:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 145,
+                'name'       => 'mail.from.name',
+                'value'      => '',
+                'created_at' => '2018-08-22 21:03:01',
+                'updated_at' => '2018-08-22 21:03:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 148,
+                'name'       => 'bjyblog.notification_email',
+                'value'      => '',
+                'created_at' => '2018-08-22 21:03:01',
+                'updated_at' => '2018-08-22 21:03:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 149,
+                'name'       => 'bjyblog.head.title',
+                'value'      => '白俊遥博客,技术博客,个人博客模板, php博客系统',
+                'created_at' => '2018-08-22 21:03:01',
+                'updated_at' => '2018-08-22 21:03:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 150,
+                'name'       => 'bjyblog.qq_qun.article_id',
+                'value'      => '1',
+                'created_at' => '2018-08-22 21:03:01',
+                'updated_at' => '2018-08-22 21:03:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 151,
+                'name'       => 'bjyblog.qq_qun.number',
+                'value'      => '88199093',
+                'created_at' => '2018-08-22 21:03:01',
+                'updated_at' => '2018-08-22 21:03:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 152,
+                'name'       => 'bjyblog.qq_qun.code',
+                'value'      => '<a target="_blank" href="//shang.qq.com/wpa/qunwpa?idkey=bba3fea90444ee6caf1fb1366027873fe14e86bada254d41ce67768fadd729ee"><img border="0" src="//pub.idqqimg.com/wpa/images/group.png" alt="白俊遥博客群" title="白俊遥博客群"></a>',
+                'created_at' => '2018-08-22 21:03:01',
+                'updated_at' => '2018-08-22 21:03:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 153,
+                'name'       => 'bjyblog.qq_qun.or_code',
+                'value'      => '/images/default/qr_code.png',
+                'created_at' => '2018-08-22 21:03:01',
+                'updated_at' => '2018-08-22 21:03:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 154,
+                'name'       => 'mail.default',
+                'value'      => 'smtp',
+                'created_at' => '2018-08-22 21:03:01',
+                'updated_at' => '2018-08-22 21:03:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 155,
+                'name'       => 'mail.mailers.smtp.port',
+                'value'      => '465',
+                'created_at' => '2018-08-22 21:03:01',
+                'updated_at' => '2018-08-22 21:03:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 156,
+                'name'       => 'mail.mailers.smtp.encryption',
+                'value'      => 'ssl',
+                'created_at' => '2018-08-22 21:03:01',
+                'updated_at' => '2018-08-22 21:03:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 157,
+                'name'       => 'mail.from.address',
+                'value'      => '',
+                'created_at' => '2018-08-22 21:03:01',
+                'updated_at' => '2018-08-22 21:03:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 158,
+                'name'       => 'sentry.dsn',
+                'value'      => '',
+                'created_at' => '2018-08-22 21:03:01',
+                'updated_at' => '2018-08-22 21:03:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 159,
+                'name'       => 'database.connections.mysql.dump.dump_binary_path',
+                'value'      => '/bin/',
+                'created_at' => '2018-12-03 21:39:22',
+                'updated_at' => '2018-12-03 21:39:22',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 160,
+                'name'       => 'filesystems.disks.oss_backups.access_key',
+                'value'      => '',
+                'created_at' => '2018-12-04 22:29:52',
+                'updated_at' => '2018-12-04 22:29:52',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 161,
+                'name'       => 'filesystems.disks.oss_backups.secret_key',
+                'value'      => '',
+                'created_at' => '2018-12-04 22:29:52',
+                'updated_at' => '2018-12-04 22:29:52',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 162,
+                'name'       => 'filesystems.disks.oss_backups.bucket',
+                'value'      => '',
+                'created_at' => '2018-12-04 22:29:52',
+                'updated_at' => '2018-12-04 22:29:52',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 163,
+                'name'       => 'filesystems.disks.oss_backups.endpoint',
+                'value'      => '',
+                'created_at' => '2018-12-04 22:29:52',
+                'updated_at' => '2018-12-04 22:29:52',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 164,
+                'name'       => 'backup.backup.destination.disks',
+                'value'      => '[]',
+                'created_at' => '2018-12-04 22:29:52',
+                'updated_at' => '2018-12-04 22:29:52',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 165,
+                'name'       => 'backup.notifications.mail.to',
+                'value'      => '',
+                'created_at' => '2018-12-04 22:29:52',
+                'updated_at' => '2018-12-04 22:29:52',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 166,
+                'name'       => 'app.locale',
+                'value'      => 'en',
+                'created_at' => '2019-02-26 21:10:52',
+                'updated_at' => '2019-02-26 21:10:52',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 167,
+                'name'       => 'bjyblog.seo.use_slug',
+                'value'      => 'false',
+                'created_at' => '2019-05-19 19:43:00',
+                'updated_at' => '2019-05-19 19:43:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 168,
+                'name'       => 'bjyblog.social_share.select_plugin',
+                'value'      => 'sharejs',
+                'created_at' => '2019-05-27 22:22:00',
+                'updated_at' => '2019-05-27 22:22:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 169,
+                'name'       => 'bjyblog.social_share.jssocials_config',
+                'value'      => '{
+    shares: ["email", "twitter", "facebook", "googleplus", "linkedin", "pinterest", "stumbleupon", "pocket", "whatsapp", "messenger", "vkontakte", "telegram", "line"],
+    showLabel: false,
+    showCount: false,
+    shareIn: "popup"
+}',
+                'created_at' => '2019-05-27 22:22:00',
+                'updated_at' => '2019-05-27 22:22:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 170,
+                'name'       => 'bjyblog.social_share.sharejs_config',
+                'value'      => '{
+    sites: ["weibo", "qq", "wechat", "douban", "qzone", "linkedin", "facebook", "twitter", "google"]
+}',
+                'created_at' => '2019-05-27 22:22:00',
+                'updated_at' => '2019-05-27 22:22:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 171,
+                'name'       => 'bjyblog.logo_with_php_tag',
+                'value'      => 'true',
+                'created_at' => '2019-05-28 23:15:00',
+                'updated_at' => '2019-05-28 23:15:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 172,
+                'name'       => 'bjyblog.cdn_domain',
+                'value'      => '',
+                'created_at' => '2019-08-05 22:15:00',
+                'updated_at' => '2019-08-05 22:15:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 173,
+                'name'       => 'bjyblog.comment_audit',
+                'value'      => 'false',
+                'created_at' => '2019-10-21 22:45:00',
+                'updated_at' => '2019-10-21 22:45:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 174,
+                'name'       => 'services.baidu.appid',
+                'value'      => '',
+                'created_at' => '2019-10-21 22:45:00',
+                'updated_at' => '2019-10-21 22:45:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 175,
+                'name'       => 'services.baidu.appkey',
+                'value'      => '',
+                'created_at' => '2019-10-21 22:45:00',
+                'updated_at' => '2019-10-21 22:45:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 176,
+                'name'       => 'services.baidu.secret',
+                'value'      => '',
+                'created_at' => '2019-10-21 22:45:00',
+                'updated_at' => '2019-10-21 22:45:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 177,
+                'name'       => 'scout.driver',
+                'value'      => 'null',
+                'created_at' => '2019-11-19 22:45:00',
+                'updated_at' => '2019-11-19 22:45:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 178,
+                'name'       => 'scout.elasticsearch.prefix',
+                'value'      => 'laravel_',
+                'created_at' => '2019-11-19 22:45:00',
+                'updated_at' => '2019-11-19 22:45:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 179,
+                'name'       => 'scout.elasticsearch.host',
+                'value'      => '127.0.0.1',
+                'created_at' => '2019-11-19 22:45:00',
+                'updated_at' => '2019-11-19 22:45:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 180,
+                'name'       => 'scout.elasticsearch.port',
+                'value'      => '9200',
+                'created_at' => '2019-11-19 22:45:00',
+                'updated_at' => '2019-11-19 22:45:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 181,
+                'name'       => 'scout.elasticsearch.scheme',
+                'value'      => 'http',
+                'created_at' => '2019-11-19 22:45:00',
+                'updated_at' => '2019-11-19 22:45:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 182,
+                'name'       => 'scout.elasticsearch.user',
+                'value'      => 'null',
+                'created_at' => '2019-11-19 22:45:00',
+                'updated_at' => '2019-11-19 22:45:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 183,
+                'name'       => 'scout.elasticsearch.pass',
+                'value'      => 'null',
+                'created_at' => '2019-11-19 22:45:00',
+                'updated_at' => '2019-11-19 22:45:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 184,
+                'name'       => 'scout.elasticsearch.analyzer',
+                'value'      => 'ik_max_word',
+                'created_at' => '2019-11-19 22:45:00',
+                'updated_at' => '2019-11-19 22:45:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 185,
+                'name'       => 'session.domain',
+                'value'      => '',
+                'created_at' => '2019-12-14 10:49:00',
+                'updated_at' => '2019-12-14 10:49:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 186,
+                'name'       => 'scout.algolia.id',
+                'value'      => '',
+                'created_at' => '2019-12-16 22:45:00',
+                'updated_at' => '2019-12-16 22:45:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 187,
+                'name'       => 'scout.algolia.secret',
+                'value'      => '',
+                'created_at' => '2019-12-16 10:49:00',
+                'updated_at' => '2019-12-16 10:49:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 188,
+                'name'       => 'bjyblog.social_links.github',
+                'value'      => '',
+                'created_at' => '2019-12-22 23:55:00',
+                'updated_at' => '2019-12-22 23:55:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 189,
+                'name'       => 'bjyblog.social_links.gitee',
+                'value'      => '',
+                'created_at' => '2019-12-22 23:55:00',
+                'updated_at' => '2019-12-22 23:55:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 190,
+                'name'       => 'bjyblog.social_links.zhihu',
+                'value'      => '',
+                'created_at' => '2019-12-22 23:55:00',
+                'updated_at' => '2019-12-22 23:55:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 191,
+                'name'       => 'bjyblog.social_links.weibo',
+                'value'      => '',
+                'created_at' => '2019-12-22 23:55:00',
+                'updated_at' => '2019-12-22 23:55:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 192,
+                'name'       => 'bjyblog.social_links.upyun',
+                'value'      => '',
+                'created_at' => '2019-12-22 23:55:00',
+                'updated_at' => '2019-12-22 23:55:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 193,
+                'name'       => 'bjyblog.link_target',
+                'value'      => '_blank',
+                'created_at' => '2019-12-25 23:06:00',
+                'updated_at' => '2019-12-25 23:06:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 194,
+                'name'       => 'bjyblog.breadcrumb',
+                'value'      => 'true',
+                'created_at' => '2020-01-01 01:01:01',
+                'updated_at' => '2020-01-01 01:01:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 195,
+                'name'       => 'app.timezone',
+                'value'      => 'PRC',
+                'created_at' => '2020-01-27 01:01:01',
+                'updated_at' => '2020-01-27 01:01:01',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 196,
+                'name'       => 'bjyblog.licenses.allow_adaptation',
+                'value'      => '-nd',
+                'created_at' => '2020-03-31 23:06:00',
+                'updated_at' => '2020-03-31 23:06:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 197,
+                'name'       => 'bjyblog.licenses.allow_commercial',
+                'value'      => '-nc',
+                'created_at' => '2020-03-31 23:06:00',
+                'updated_at' => '2020-03-31 23:06:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 198,
+                'name'       => 'bjyblog.licenses.language',
+                'value'      => 'en',
+                'created_at' => '2020-03-31 01:06:00',
+                'updated_at' => '2020-03-31 01:06:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 199,
+                'name'       => 'bjyblog.theme',
+                'value'      => 'blueberry',
+                'created_at' => '2020-05-12 23:06:00',
+                'updated_at' => '2020-05-12 23:06:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 200,
+                'name'       => 'filesystems.disks.oss_uploads.access_key',
+                'value'      => '',
+                'created_at' => '2020-06-26 23:29:52',
+                'updated_at' => '2020-06-26 23:29:52',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 201,
+                'name'       => 'filesystems.disks.oss_uploads.secret_key',
+                'value'      => '',
+                'created_at' => '2020-06-26 23:29:52',
+                'updated_at' => '2020-06-26 23:29:52',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 202,
+                'name'       => 'filesystems.disks.oss_uploads.bucket',
+                'value'      => '',
+                'created_at' => '2020-06-26 23:29:52',
+                'updated_at' => '2020-06-26 23:29:52',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 203,
+                'name'       => 'filesystems.disks.oss_uploads.endpoint',
+                'value'      => '',
+                'created_at' => '2020-06-26 23:29:52',
+                'updated_at' => '2020-06-26 23:29:52',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 204,
+                'name'       => 'bjyblog.upload_disks',
+                'value'      => '["public"]',
+                'created_at' => '2018-12-04 22:29:52',
+                'updated_at' => '2018-12-04 22:29:52',
+                'deleted_at' => null,
+            ],
+        ]);
+    }
+}

+ 329 - 0
tests/Commands/Upgrade/databases/V17_0_0/seeds/ConsolesTableSeeder.php

@@ -0,0 +1,329 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Seeds;
+
+use Illuminate\Database\Seeder;
+use Illuminate\Support\Facades\DB;
+
+class ConsolesTableSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        if (DB::table('consoles')->exists()) {
+            $this->command->getOutput()->writeln('<question>Skipping: ' . __CLASS__ . '</question>');
+
+            return;
+        }
+
+        DB::table('consoles')->insert([
+            [
+                'id'         => 1,
+                'name'       => 'App\Console\Commands\Upgrade\V5_5_5_0',
+                'created_at' => '2018-09-27 22:26:00',
+                'updated_at' => '2018-09-27 22:26:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 3,
+                'name'       => 'App\Console\Commands\Upgrade\V5_5_6_0',
+                'created_at' => '2018-09-28 10:26:00',
+                'updated_at' => '2018-09-28 10:26:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 4,
+                'name'       => 'App\Console\Commands\Upgrade\V5_5_7_0',
+                'created_at' => '2018-11-06 22:26:00',
+                'updated_at' => '2018-11-06 22:26:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 5,
+                'name'       => 'App\Console\Commands\Upgrade\V5_5_8_0',
+                'created_at' => '2018-12-31 21:03:00',
+                'updated_at' => '2018-12-31 21:03:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 6,
+                'name'       => 'App\Console\Commands\Upgrade\V5_5_9_0',
+                'created_at' => '2018-12-31 21:03:00',
+                'updated_at' => '2018-12-31 21:03:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 7,
+                'name'       => 'App\Console\Commands\Upgrade\V5_5_10_0',
+                'created_at' => '2018-12-31 21:03:00',
+                'updated_at' => '2018-12-31 21:03:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 8,
+                'name'       => 'App\Console\Commands\Upgrade\V5_5_11_0',
+                'created_at' => '2019-02-26 21:10:00',
+                'updated_at' => '2019-02-26 21:10:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 9,
+                'name'       => 'App\Console\Commands\Upgrade\V5_8_1_0',
+                'created_at' => '2019-02-26 21:10:00',
+                'updated_at' => '2019-02-26 21:10:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 10,
+                'name'       => 'App\Console\Commands\Upgrade\V5_8_2_0',
+                'created_at' => '2019-02-26 21:10:00',
+                'updated_at' => '2019-02-26 21:10:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 11,
+                'name'       => 'App\Console\Commands\Upgrade\V5_8_3_0',
+                'created_at' => '2019-05-17 21:10:00',
+                'updated_at' => '2019-05-17 21:10:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 12,
+                'name'       => 'App\Console\Commands\Upgrade\V5_8_4_0',
+                'created_at' => '2019-05-19 18:28:00',
+                'updated_at' => '2019-05-19 18:28:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 13,
+                'name'       => 'App\Console\Commands\Upgrade\V5_8_5_0',
+                'created_at' => '2019-06-01 18:28:00',
+                'updated_at' => '2019-06-01 18:28:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 14,
+                'name'       => 'App\Console\Commands\Upgrade\V5_8_6_0',
+                'created_at' => '2019-06-22 18:28:00',
+                'updated_at' => '2019-06-22 18:28:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 15,
+                'name'       => 'App\Console\Commands\Upgrade\V5_8_7_0',
+                'created_at' => '2019-06-28 18:28:00',
+                'updated_at' => '2019-06-28 18:28:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 16,
+                'name'       => 'App\Console\Commands\Upgrade\V5_8_8_0',
+                'created_at' => '2019-07-01 22:28:00',
+                'updated_at' => '2019-07-01 22:28:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 18,
+                'name'       => 'App\Console\Commands\Upgrade\V5_8_9_0',
+                'created_at' => '2019-07-27 14:28:00',
+                'updated_at' => '2019-07-27 14:28:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 19,
+                'name'       => 'App\Console\Commands\Upgrade\V5_8_10_0',
+                'created_at' => '2019-08-02 22:01:00',
+                'updated_at' => '2019-08-02 22:01:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 20,
+                'name'       => 'App\Console\Commands\Upgrade\V5_8_11_0',
+                'created_at' => '2019-08-05 22:11:00',
+                'updated_at' => '2019-08-05 22:11:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 21,
+                'name'       => 'App\Console\Commands\Upgrade\V6_0_0',
+                'created_at' => '2019-09-18 22:30:00',
+                'updated_at' => '2019-09-18 22:30:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 22,
+                'name'       => 'App\Console\Commands\Upgrade\V6_1_0',
+                'created_at' => '2019-09-28 22:30:00',
+                'updated_at' => '2019-09-28 22:30:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 23,
+                'name'       => 'App\Console\Commands\Upgrade\V6_2_0',
+                'created_at' => '2019-10-20 10:30:00',
+                'updated_at' => '2019-10-20 10:30:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 24,
+                'name'       => 'App\Console\Commands\Upgrade\V6_3_0',
+                'created_at' => '2019-10-26 13:35:00',
+                'updated_at' => '2019-10-26 13:35:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 25,
+                'name'       => 'App\Console\Commands\Upgrade\V6_4_0',
+                'created_at' => '2019-11-09 10:35:00',
+                'updated_at' => '2019-11-09 10:35:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 26,
+                'name'       => 'App\Console\Commands\Upgrade\V6_5_0',
+                'created_at' => '2019-11-09 10:35:00',
+                'updated_at' => '2019-11-09 10:35:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 27,
+                'name'       => 'App\Console\Commands\Upgrade\V6_6_0',
+                'created_at' => '2019-12-14 13:03:00',
+                'updated_at' => '2019-12-14 13:03:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 28,
+                'name'       => 'App\Console\Commands\Upgrade\V6_7_0',
+                'created_at' => '2019-12-21 11:03:00',
+                'updated_at' => '2019-12-21 11:03:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 29,
+                'name'       => 'App\Console\Commands\Upgrade\V6_8_0',
+                'created_at' => '2019-12-27 22:13:00',
+                'updated_at' => '2019-12-27 22:13:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 30,
+                'name'       => 'App\Console\Commands\Upgrade\V6_9_0',
+                'created_at' => '2020-01-03 22:13:00',
+                'updated_at' => '2020-01-03 22:13:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 31,
+                'name'       => 'App\Console\Commands\Upgrade\V6_10_0',
+                'created_at' => '2020-01-17 22:13:00',
+                'updated_at' => '2020-01-17 22:13:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 32,
+                'name'       => 'App\Console\Commands\Upgrade\V6_11_0',
+                'created_at' => '2020-01-20 22:13:00',
+                'updated_at' => '2020-01-20 22:13:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 33,
+                'name'       => 'App\Console\Commands\Upgrade\V6_12_0',
+                'created_at' => '2020-01-27 22:13:00',
+                'updated_at' => '2020-01-27 22:13:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 34,
+                'name'       => 'App\Console\Commands\Upgrade\V6_13_0',
+                'created_at' => '2020-01-28 15:13:00',
+                'updated_at' => '2020-01-28 15:13:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 35,
+                'name'       => 'App\Console\Commands\Upgrade\V6_14_0',
+                'created_at' => '2020-02-10 21:13:00',
+                'updated_at' => '2020-02-10 21:13:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 36,
+                'name'       => 'App\Console\Commands\Upgrade\V7_0_0',
+                'created_at' => '2020-03-13 20:13:00',
+                'updated_at' => '2020-03-13 20:13:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 37,
+                'name'       => 'App\Console\Commands\Upgrade\V8_0_0',
+                'created_at' => '2020-03-31 23:35:00',
+                'updated_at' => '2020-03-31 23:35:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 38,
+                'name'       => 'App\Console\Commands\Upgrade\V9_0_0',
+                'created_at' => '2020-04-20 23:35:00',
+                'updated_at' => '2020-04-20 23:35:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 39,
+                'name'       => 'App\Console\Commands\Upgrade\V10_0_0',
+                'created_at' => '2020-05-12 23:35:00',
+                'updated_at' => '2020-05-12 23:35:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 40,
+                'name'       => 'App\Console\Commands\Upgrade\V11_0_0',
+                'created_at' => '2020-06-19 23:35:00',
+                'updated_at' => '2020-06-19 23:35:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 41,
+                'name'       => 'App\Console\Commands\Upgrade\V12_0_0',
+                'created_at' => '2020-09-13 23:00:00',
+                'updated_at' => '2020-09-13 23:00:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 42,
+                'name'       => 'App\Console\Commands\Upgrade\V13_0_0',
+                'created_at' => '2020-09-21 23:21:00',
+                'updated_at' => '2020-09-21 23:21:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 43,
+                'name'       => 'App\Console\Commands\Upgrade\V14_0_0',
+                'created_at' => '2020-10-04 23:21:00',
+                'updated_at' => '2020-10-04 23:21:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 44,
+                'name'       => 'App\Console\Commands\Upgrade\V15_0_0',
+                'created_at' => '2021-02-18 23:16:00',
+                'updated_at' => '2021-02-18 23:16:00',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 45,
+                'name'       => 'App\Console\Commands\Upgrade\V16_0_0',
+                'created_at' => '2021-05-29 23:16:00',
+                'updated_at' => '2021-05-29 23:16:00',
+                'deleted_at' => null,
+            ],
+        ]);
+    }
+}

+ 27 - 0
tests/Commands/Upgrade/databases/V17_0_0/seeds/DatabaseSeeder.php

@@ -0,0 +1,27 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Seeds;
+
+use File;
+use Illuminate\Database\Seeder;
+
+class DatabaseSeeder extends Seeder
+{
+    /**
+     * Seed the application's database.
+     */
+    public function run(): void
+    {
+        $files = File::files(database_path('seeds'));
+
+        foreach ($files as $file) {
+            $classFQCN = 'Database\\Seeders\\' . $file->getFilenameWithoutExtension();
+
+            if ($classFQCN !== __CLASS__) {
+                $this->call($classFQCN);
+            }
+        }
+    }
+}

+ 46 - 0
tests/Commands/Upgrade/databases/V17_0_0/seeds/FriendsTableSeeder.php

@@ -0,0 +1,46 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Seeds;
+
+use Illuminate\Database\Seeder;
+use Illuminate\Support\Facades\DB;
+
+class FriendsTableSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        if (DB::table('friends')->exists()) {
+            $this->command->getOutput()->writeln('<question>Skipping: ' . __CLASS__ . '</question>');
+
+            return;
+        }
+
+        DB::table('friends')->insert([
+            [
+                'id'         => 1,
+                'name'       => '白俊遥博客',
+                'url'        => 'https://baijunyao.com',
+                'sort'       => 1,
+                'created_at' => '2017-7-16 07:35:12',
+                'updated_at' => '2016-7-16 07:35:12',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 2,
+                'name'       => '已删除',
+                'url'        => 'https://deleted.com',
+                'sort'       => 2,
+                'created_at' => '2019-01-04 16:35:12',
+                'updated_at' => '2019-01-04 16:35:12',
+                'deleted_at' => '2019-01-04 16:35:12',
+            ],
+        ]);
+    }
+}

+ 52 - 0
tests/Commands/Upgrade/databases/V17_0_0/seeds/NavsTableSeeder.php

@@ -0,0 +1,52 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Seeds;
+
+use Illuminate\Database\Seeder;
+use Illuminate\Support\Facades\DB;
+
+class NavsTableSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        if (DB::table('navs')->exists()) {
+            $this->command->getOutput()->writeln('<question>Skipping: ' . __CLASS__ . '</question>');
+
+            return;
+        }
+
+        DB::table('navs')->insert([
+            [
+                'id'         => 1,
+                'name'       => '随言碎语',
+                'url'        => 'notes',
+                'created_at' => '2018-08-04 12:41:26',
+                'updated_at' => '2018-08-04 12:41:26',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 2,
+                'name'       => '开源项目',
+                'url'        => 'openSources',
+                'created_at' => '2018-08-04 12:41:26',
+                'updated_at' => '2018-08-04 12:41:26',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 3,
+                'name'       => '已删除',
+                'url'        => 'deleted',
+                'created_at' => '2019-01-04 16:35:12',
+                'updated_at' => '2019-01-04 16:35:12',
+                'deleted_at' => '2019-01-04 16:35:12',
+            ],
+        ]);
+    }
+}

+ 42 - 0
tests/Commands/Upgrade/databases/V17_0_0/seeds/NotesTableSeeder.php

@@ -0,0 +1,42 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Seeds;
+
+use Illuminate\Database\Seeder;
+use Illuminate\Support\Facades\DB;
+
+class NotesTableSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        if (DB::table('notes')->exists()) {
+            $this->command->getOutput()->writeln('<question>Skipping: ' . __CLASS__ . '</question>');
+
+            return;
+        }
+
+        DB::table('notes')->insert([
+            [
+                'id'         => 1,
+                'content'    => '技术这东西;懂的越多;不懂的就越多;',
+                'created_at' => '2017-7-18 07:35:12',
+                'updated_at' => '2016-7-18 07:35:12',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 2,
+                'content'    => '已删除',
+                'created_at' => '2019-01-04 16:35:12',
+                'updated_at' => '2019-01-04 16:35:12',
+                'deleted_at' => '2019-01-04 16:35:12',
+            ],
+        ]);
+    }
+}

+ 40 - 0
tests/Commands/Upgrade/databases/V17_0_0/seeds/OauthClientsTableSeeder.php

@@ -0,0 +1,40 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Seeds;
+
+use Illuminate\Database\Seeder;
+use Illuminate\Support\Facades\DB;
+
+class OauthClientsTableSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        if (DB::table('oauth_clients')->exists()) {
+            $this->command->getOutput()->writeln('<question>Skipping: ' . __CLASS__ . '</question>');
+
+            return;
+        }
+
+        DB::table('oauth_clients')->insert([
+            [
+                'id'                     => 1,
+                'user_id'                => null,
+                'name'                   => config('app.name') . ' Password Grant Client',
+                'secret'                 => '',
+                'redirect'               => 'http://localhost',
+                'personal_access_client' => 0,
+                'password_client'        => 1,
+                'revoked'                => 0,
+                'created_at'             => '2019-06-29 20:35:12',
+                'updated_at'             => '2019-06-29 20:35:12',
+            ],
+        ]);
+    }
+}

+ 109 - 0
tests/Commands/Upgrade/databases/V17_0_0/seeds/OpenSourcesTableSeeder.php

@@ -0,0 +1,109 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Seeds;
+
+use Illuminate\Database\Seeder;
+use Illuminate\Support\Facades\DB;
+
+class OpenSourcesTableSeeder extends Seeder
+{
+    /**
+     * Auto generated seed file
+     *
+     * @return void
+     */
+    public function run()
+    {
+        if (DB::table('open_sources')->exists()) {
+            $this->command->getOutput()->writeln('<question>Skipping: ' . __CLASS__ . '</question>');
+
+            return;
+        }
+
+        DB::table('open_sources')->insert([
+            [
+                'id'         => 1,
+                'sort'       => 1,
+                'type'       => 1,
+                'name'       => 'baijunyao/thinkphp-bjyadmin',
+                'created_at' => '2017-10-23 21:09:04',
+                'updated_at' => '2017-10-26 21:42:40',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 2,
+                'sort'       => 2,
+                'type'       => 2,
+                'name'       => 'baijunyao/thinkphp-bjyadmin',
+                'created_at' => '2017-10-26 21:43:07',
+                'updated_at' => '2017-10-26 22:02:28',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 3,
+                'sort'       => 3,
+                'type'       => 1,
+                'name'       => 'baijunyao/thinkphp-bjyblog',
+                'created_at' => '2017-10-26 21:43:26',
+                'updated_at' => '2017-10-26 22:02:40',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 4,
+                'sort'       => 4,
+                'type'       => 2,
+                'name'       => 'baijunyao/thinkbjy',
+                'created_at' => '2017-10-26 21:43:56',
+                'updated_at' => '2017-10-26 22:02:59',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 5,
+                'sort'       => 5,
+                'type'       => 1,
+                'name'       => 'baijunyao/laravel-bjyadmin',
+                'created_at' => '2017-10-26 22:03:15',
+                'updated_at' => '2017-10-26 22:03:15',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 6,
+                'sort'       => 6,
+                'type'       => 1,
+                'name'       => 'baijunyao/laravel-bjyblog',
+                'created_at' => '2017-10-26 22:03:23',
+                'updated_at' => '2017-10-26 22:03:23',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 7,
+                'sort'       => 7,
+                'type'       => 2,
+                'name'       => 'baijunyao/laravel-bjyadmin',
+                'created_at' => '2017-10-26 22:07:24',
+                'updated_at' => '2017-10-26 22:07:59',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 8,
+                'sort'       => 8,
+                'type'       => 2,
+                'name'       => 'baijunyao/laravel-bjyblog',
+                'created_at' => '2017-10-26 22:07:47',
+                'updated_at' => '2017-10-26 22:08:04',
+                'deleted_at' => null,
+            ],
+            [
+                'id'         => 9,
+                'sort'       => 9,
+                'type'       => 2,
+                'name'       => 'deleted/deleted',
+                'created_at' => '2019-01-04 16:35:12',
+                'updated_at' => '2019-01-04 16:35:12',
+                'deleted_at' => '2019-01-04 16:35:12',
+            ],
+        ]);
+    }
+}

+ 52 - 0
tests/Commands/Upgrade/databases/V17_0_0/seeds/SitesTableSeeder.php

@@ -0,0 +1,52 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Seeds;
+
+use Illuminate\Database\Seeder;
+use Illuminate\Support\Facades\DB;
+
+class SitesTableSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        if (DB::table('sites')->exists()) {
+            $this->command->getOutput()->writeln('<question>Skipping: ' . __CLASS__ . '</question>');
+
+            return;
+        }
+
+        DB::table('sites')->insert([
+            [
+                'id'                => 1,
+                'socialite_user_id' => 1,
+                'name'              => '白俊遥博客',
+                'description'       => '白俊遥的个人博客',
+                'url'               => 'https://baijunyao.com',
+                'audit'             => 0,
+                'sort'              => 1,
+                'created_at'        => '2018-11-15 20:35:12',
+                'updated_at'        => '2018-11-15 20:35:12',
+                'deleted_at'        => null,
+            ],
+            [
+                'id'                => 2,
+                'socialite_user_id' => 1,
+                'name'              => '已删除',
+                'description'       => '用于测试',
+                'url'               => 'https://deleted.com',
+                'audit'             => 1,
+                'sort'              => 1,
+                'created_at'        => '2019-01-04 16:35:12',
+                'updated_at'        => '2019-01-04 16:35:12',
+                'deleted_at'        => '2019-01-04 16:35:12',
+            ],
+        ]);
+    }
+}

+ 88 - 0
tests/Commands/Upgrade/databases/V17_0_0/seeds/SocialiteClientsTableSeeder.php

@@ -0,0 +1,88 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Seeds;
+
+use Illuminate\Database\Seeder;
+use Illuminate\Support\Facades\DB;
+
+class SocialiteClientsTableSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        if (DB::table('socialite_clients')->exists()) {
+            $this->command->getOutput()->writeln('<question>Skipping: ' . __CLASS__ . '</question>');
+
+            return;
+        }
+
+        DB::table('socialite_clients')->insert([
+            [
+                'id'            => 1,
+                'name'          => 'qq',
+                'icon'          => 'qq',
+                'client_id'     => '',
+                'client_secret' => '',
+                'created_at'    => '2019-05-08 22:13:54',
+                'updated_at'    => '2019-05-08 22:13:54',
+                'deleted_at'    => null,
+            ],
+            [
+                'id'            => 2,
+                'name'          => 'weibo',
+                'icon'          => 'weibo',
+                'client_id'     => '',
+                'client_secret' => '',
+                'created_at'    => '2019-05-08 22:13:54',
+                'updated_at'    => '2019-05-08 22:13:54',
+                'deleted_at'    => null,
+            ],
+            [
+                'id'            => 3,
+                'name'          => 'github',
+                'icon'          => 'github',
+                'client_id'     => '',
+                'client_secret' => '',
+                'created_at'    => '2019-05-08 22:13:54',
+                'updated_at'    => '2019-05-08 22:13:54',
+                'deleted_at'    => null,
+            ],
+            [
+                'id'            => 4,
+                'name'          => 'google',
+                'icon'          => 'google',
+                'client_id'     => '',
+                'client_secret' => '',
+                'created_at'    => '2019-05-14 23:26:38',
+                'updated_at'    => '2019-05-14 23:26:38',
+                'deleted_at'    => null,
+            ],
+            [
+                'id'            => 5,
+                'name'          => 'facebook',
+                'icon'          => 'facebook',
+                'client_id'     => '',
+                'client_secret' => '',
+                'created_at'    => '2019-05-14 23:26:38',
+                'updated_at'    => '2019-05-14 23:26:38',
+                'deleted_at'    => null,
+            ],
+            [
+                'id'            => 6,
+                'name'          => 'vkontakte',
+                'icon'          => 'vk',
+                'client_id'     => '',
+                'client_secret' => '',
+                'created_at'    => '2019-07-01 23:26:38',
+                'updated_at'    => '2019-07-01 23:26:38',
+                'deleted_at'    => null,
+            ],
+        ]);
+    }
+}

+ 58 - 0
tests/Commands/Upgrade/databases/V17_0_0/seeds/SocialiteUsersTableSeeder.php

@@ -0,0 +1,58 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Seeds;
+
+use Illuminate\Database\Seeder;
+use Illuminate\Support\Facades\DB;
+
+class SocialiteUsersTableSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        if (DB::table('socialite_users')->exists()) {
+            $this->command->getOutput()->writeln('<question>Skipping: ' . __CLASS__ . '</question>');
+
+            return;
+        }
+
+        DB::table('socialite_users')->insert([
+            [
+                'id'                           => 1,
+                'socialite_client_id'          => 1,
+                'name'                         => '白俊遥',
+                'avatar'                       => '/images/default/avatar.jpg',
+                'openid'                       => '1',
+                'access_token'                 => '',
+                'last_login_ip'                => '127.0.0.1',
+                'login_times'                  => 1,
+                'email'                        => 'baijunyao@baijunyao.com',
+                'is_admin'                     => 0,
+                'created_at'                   => '2017-7-24 07:35:12',
+                'updated_at'                   => '2017-7-24 07:35:12',
+                'deleted_at'                   => null,
+            ],
+            [
+                'id'                           => 2,
+                'socialite_client_id'          => 1,
+                'name'                         => '已删除',
+                'avatar'                       => '/images/default/avatar.jpg',
+                'openid'                       => '2',
+                'access_token'                 => '',
+                'last_login_ip'                => '127.0.0.1',
+                'login_times'                  => 1,
+                'email'                        => 'deleted@baijunyao.com',
+                'is_admin'                     => 0,
+                'created_at'                   => '2019-01-04 16:35:12',
+                'updated_at'                   => '2019-01-04 16:35:12',
+                'deleted_at'                   => '2019-01-04 16:35:12',
+            ],
+        ]);
+    }
+}

+ 58 - 0
tests/Commands/Upgrade/databases/V17_0_0/seeds/TagsTableSeeder.php

@@ -0,0 +1,58 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Seeds;
+
+use Illuminate\Database\Seeder;
+use Illuminate\Support\Facades\DB;
+
+class TagsTableSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        if (DB::table('tags')->exists()) {
+            $this->command->getOutput()->writeln('<question>Skipping: ' . __CLASS__ . '</question>');
+
+            return;
+        }
+
+        DB::table('tags')->insert([
+            [
+                'id'          => 1,
+                'name'        => 'laravel',
+                'slug'        => 'laravel',
+                'keywords'    => 'laravel',
+                'description' => 'Laravel是一套简洁、优雅的PHP Web开发框架(PHP Web Framework)。它可以让你从面条一样杂乱的代码中解脱出来;它可以帮你构建一个完美的网络APP,而且每行代码都可以简洁、富于表达力。',
+                'created_at'  => '2017-7-16 07:35:12',
+                'updated_at'  => '2016-7-16 07:35:12',
+                'deleted_at'  => null,
+            ],
+            [
+                'id'          => 2,
+                'name'        => 'test',
+                'slug'        => 'test',
+                'keywords'    => 'test',
+                'description' => '测试描述',
+                'created_at'  => '2019-01-04 15:35:12',
+                'updated_at'  => '2019-01-04 15:35:12',
+                'deleted_at'  => null,
+            ],
+            [
+                'id'          => 3,
+                'name'        => '已删除',
+                'slug'        => 'deleted',
+                'keywords'    => 'delete',
+                'description' => '删除的标签',
+                'created_at'  => '2019-01-04 15:35:12',
+                'updated_at'  => '2019-01-04 15:35:12',
+                'deleted_at'  => '2019-01-04 15:35:12',
+            ],
+        ]);
+    }
+}

+ 48 - 0
tests/Commands/Upgrade/databases/V17_0_0/seeds/UsersTableSeeder.php

@@ -0,0 +1,48 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Tests\Commands\Upgrade\Databases\V17_0_0\Seeds;
+
+use Illuminate\Database\Seeder;
+use Illuminate\Support\Facades\DB;
+
+class UsersTableSeeder extends Seeder
+{
+    /**
+     * Auto generated seed file
+     *
+     * @return void
+     */
+    public function run()
+    {
+        if (DB::table('users')->exists()) {
+            $this->command->getOutput()->writeln('<question>Skipping: ' . __CLASS__ . '</question>');
+
+            return;
+        }
+
+        DB::table('users')->insert([
+            [
+                'id'             => 1,
+                'name'           => 'test',
+                'email'          => 'test@test.com',
+                'password'       => bcrypt(123456),
+                'remember_token' => null,
+                'created_at'     => '2016-10-22 07:35:12',
+                'updated_at'     => '2016-10-22 07:35:12',
+                'deleted_at'     => null,
+            ],
+            [
+                'id'             => 2,
+                'name'           => '已删除',
+                'email'          => 'deleted@test.com',
+                'password'       => bcrypt(123456),
+                'remember_token' => null,
+                'created_at'     => '2019-01-04 15:35:12',
+                'updated_at'     => '2016-01-04 15:35:12',
+                'deleted_at'     => '2016-01-04 15:35:12',
+            ],
+        ]);
+    }
+}

+ 34 - 2
tests/_baseline/Feature/Resources/ConfigControllerTest__testIndex__1.json

@@ -613,6 +613,38 @@
                 "created_at": "2018-12-04 22:29:52",
                 "updated_at": "2018-12-04 22:29:52",
                 "deleted_at": null
+            },
+            {
+                "id": 205,
+                "name": "services.tencent_cloud.secret_id",
+                "value": "",
+                "created_at": "2022-06-15 20:06:00",
+                "updated_at": "2022-06-15 20:06:00",
+                "deleted_at": null
+            },
+            {
+                "id": 206,
+                "name": "services.tencent_cloud.secret_key",
+                "value": "",
+                "created_at": "2022-06-15 20:06:00",
+                "updated_at": "2022-06-15 20:06:00",
+                "deleted_at": null
+            },
+            {
+                "id": 207,
+                "name": "services.tencent_cloud.region",
+                "value": "",
+                "created_at": "2022-06-15 20:06:00",
+                "updated_at": "2022-06-15 20:06:00",
+                "deleted_at": null
+            },
+            {
+                "id": 208,
+                "name": "services.tencent_cloud.project_id",
+                "value": "",
+                "created_at": "2022-06-15 20:06:00",
+                "updated_at": "2022-06-15 20:06:00",
+                "deleted_at": null
             }
         ],
         "links": {
@@ -644,8 +676,8 @@
             ],
             "path": "http:\/\/laravel-bjyblog.test\/api\/configs",
             "per_page": 1000,
-            "to": 74,
-            "total": 74
+            "to": 78,
+            "total": 78
         }
     }
 }