2017-04-16 10:04:47 +01:00
|
|
|
<?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) {
|
2017-04-17 17:11:59 +01:00
|
|
|
$table->bigInteger('hits')->default(0);
|
2017-04-16 10:04:47 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
Schema::table('photos', function (Blueprint $table) {
|
2017-04-17 17:11:59 +01:00
|
|
|
$table->bigInteger('hits')->default(0);
|
|
|
|
$table->bigInteger('hits_download')->default(0);
|
2017-04-16 10:04:47 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::table('photos', function (Blueprint $table) {
|
2017-04-17 15:45:25 +01:00
|
|
|
$table->dropColumn('hits_download');
|
2017-04-16 10:04:47 +01:00
|
|
|
$table->dropColumn('hits');
|
|
|
|
});
|
|
|
|
|
|
|
|
Schema::table('albums', function (Blueprint $table) {
|
|
|
|
$table->dropColumn('hits');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|