|
17 | 17 | */ |
18 | 18 | public function up(): void |
19 | 19 | { |
20 | | - if (Schema::hasTable('results')) { |
21 | | - /** |
22 | | - * Rename the existing table so that a backup copy exists. |
23 | | - */ |
24 | | - Schema::rename('results', 'results_bad_json'); |
25 | | - } |
| 20 | + if (! Schema::hasTable('results') && ! Schema::hasTable('results_bad_json')) { |
| 21 | + if (Schema::hasTable('results')) { |
| 22 | + /** |
| 23 | + * Rename the existing table so that a backup copy exists. |
| 24 | + */ |
| 25 | + Schema::rename('results', 'results_bad_json'); |
| 26 | + } |
26 | 27 |
|
27 | | - if (! Schema::hasTable('results')) { |
28 | | - /** |
29 | | - * Create a new results table based on a new DDL schema. |
30 | | - */ |
31 | | - Schema::create('results', function (Blueprint $table) { |
32 | | - $table->id(); |
33 | | - $table->string('service')->default('ookla'); |
34 | | - $table->float('ping', 8, 3)->nullable(); |
35 | | - $table->unsignedBigInteger('download')->nullable(); |
36 | | - $table->unsignedBigInteger('upload')->nullable(); |
37 | | - $table->text('comments')->nullable(); |
38 | | - $table->json('data')->nullable(); |
39 | | - $table->string('status'); |
40 | | - $table->boolean('scheduled')->default(false); |
41 | | - $table->timestamps(); |
42 | | - }); |
| 28 | + if (! Schema::hasTable('results')) { |
| 29 | + /** |
| 30 | + * Create a new results table based on a new DDL schema. |
| 31 | + */ |
| 32 | + Schema::create('results', function (Blueprint $table) { |
| 33 | + $table->id(); |
| 34 | + $table->string('service')->default('ookla'); |
| 35 | + $table->float('ping', 8, 3)->nullable(); |
| 36 | + $table->unsignedBigInteger('download')->nullable(); |
| 37 | + $table->unsignedBigInteger('upload')->nullable(); |
| 38 | + $table->text('comments')->nullable(); |
| 39 | + $table->json('data')->nullable(); |
| 40 | + $table->string('status'); |
| 41 | + $table->boolean('scheduled')->default(false); |
| 42 | + $table->timestamps(); |
| 43 | + }); |
| 44 | + } |
43 | 45 | } |
44 | 46 |
|
45 | 47 | /** |
|
0 commit comments