| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | public function up() |
||
| 13 | { |
||
| 14 | Schema::table('cloud_storages', function (Blueprint $table) { |
||
| 15 | $table->timestamp('enabled_at')->nullable(); |
||
| 16 | $table->timestamp('disabled_at')->nullable(); |
||
| 17 | }); |
||
| 18 | |||
| 19 | // Need to make sure we have some enabled_at date for all currently enabled connections |
||
| 20 | \STS\StorageConnect\Models\CloudStorage::where('enabled', 1)->get()->each(function($storage) { |
||
| 21 | $storage->update(['enabled_at' => $storage->created_at]); |
||
| 22 | }); |
||
| 23 | |||
| 24 | // Same for disabled |
||
| 25 | \STS\StorageConnect\Models\CloudStorage::where('enabled', 0)->get()->each(function($storage) { |
||
| 26 | $storage->update(['disabled_at' => $storage->updated_at]); |
||
| 27 | }); |
||
| 28 | } |
||
| 29 | |||
| 37 | } |