Файл: database/migrations/2022_11_06_042415_v3_5_0.php
Строк: 31
<?php
use IlluminateDatabaseMigrationsMigration;
use IlluminateDatabaseSchemaBlueprint;
use IlluminateSupportFacadesSchema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('pages', function ($table) {
$table->renameColumn('footer', 'visibility');
});
foreach (DB::table('plans')->select('*')->cursor() as $row) {
$features = json_decode($row->features);
DB::statement("UPDATE `plans` SET `features` = :features WHERE `id` = :id", ['features' => json_encode(['pageviews' => $features->pageviews, 'websites' => -1, 'email_reports' => 1, 'data_export' => 1, 'api' => 1]), 'id' => $row->id]);
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
};