43 lines
957 B
PHP
43 lines
957 B
PHP
|
<?php
|
||
|
|
||
|
use Illuminate\Support\Facades\Schema;
|
||
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
use Illuminate\Database\Migrations\Migration;
|
||
|
|
||
|
class AttachHitColumns extends Migration
|
||
|
{
|
||
|
/**
|
||
|
* Run the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function up()
|
||
|
{
|
||
|
Schema::table('albums', function (Blueprint $table) {
|
||
|
$table->bigInteger('hits');
|
||
|
});
|
||
|
|
||
|
Schema::table('photos', function (Blueprint $table) {
|
||
|
$table->bigInteger('hits');
|
||
|
$table->bigInteger('hits_download');
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Reverse the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function down()
|
||
|
{
|
||
|
Schema::table('photos', function (Blueprint $table) {
|
||
|
$table->bigInteger('hits_download');
|
||
|
$table->dropColumn('hits');
|
||
|
});
|
||
|
|
||
|
Schema::table('albums', function (Blueprint $table) {
|
||
|
$table->dropColumn('hits');
|
||
|
});
|
||
|
}
|
||
|
}
|